package com.fhz.a2102_shop;

import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;

import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import com.fhz.a2102_shop.databinding.ActivityMainBinding;

import java.util.HashMap;

public class MainActivity extends AppCompatActivity {
//    ActivityMainBinding binding;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

//        bindingTest();

        ActivityMainBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_main);

        User user = new User();
//        user.setName("小明");
        user.setAge(16);
        user.setUrlProfile("https://www.wanandroid.com/blogimgs/62c1bd68-b5f3-4a3c-a649-7ca8c7dfabe6.png");

        HashMap<String, String> map = new HashMap<>();
        map.put("name","大明");

        binding.setMap(map);
        binding.setUser(user);
        binding.setActivity(this);


    }

    private void bindingTest() {
//        binding = ActivityMainBinding.inflate(getLayoutInflater());
//        setContentView(binding.getRoot());
    }


    public void click(View view){
        Toast.makeText(this, "哈哈", Toast.LENGTH_SHORT).show();
    }
}